LongRange

class LongRange(start: Long, endInclusive: Long) : LongProgression, ClosedRange<Long>

A range of values of type Long.

Constructors

LongRange
Link copied to clipboard
fun LongRange(start: Long, endInclusive: Long)

Types

Companion
Link copied to clipboard
object Companion

Functions

contains
Link copied to clipboard
open operator override fun contains(value: Long): Boolean

Checks whether the specified value belongs to the range.

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
isEmpty
Link copied to clipboard
open override fun isEmpty(): Boolean

Checks whether the range is empty.

iterator
Link copied to clipboard
open operator override fun iterator(): LongIterator

Returns an iterator over the elements of this object.

toString
Link copied to clipboard
open override fun toString(): String

Properties

endInclusive
Link copied to clipboard
open override val endInclusive: Long

The maximum value in the range (inclusive).

first
Link copied to clipboard
val first: Long

The first element in the progression.

last
Link copied to clipboard
val last: Long

The last element in the progression.

start
Link copied to clipboard
open override val start: Long

The minimum value in the range.

step
Link copied to clipboard
val step: Long

The step of the progression.

Extensions

contains
Link copied to clipboard
inline operator fun LongRange.contains(element: Long?): Boolean

Returns true if this range contains the specified element.

random
Link copied to clipboard
inline fun LongRange.random(): Long

Returns a random element from this range.

fun LongRange.random(random: Random): Long

Returns a random element from this range using the specified source of randomness.

randomOrNull
Link copied to clipboard
inline fun LongRange.randomOrNull(): Long?

Returns a random element from this range, or null if this range is empty.

fun LongRange.randomOrNull(random: Random): Long?

Returns a random element from this range using the specified source of randomness, or null if this range is empty.